package com.eg366.selfFrame.service;

import java.math.BigDecimal;
import java.util.Random;

import com.eg366.selfFrame.annotation.Bean;
import com.eg366.selfFrame.annotation.DoWired;
import com.eg366.selfFrame.dao.AccountDAO;
import com.eg366.selfFrame.domain.Account;

@Bean(id="accountService")
public class AccountService implements IAccountService {
	
	@DoWired
	private AccountDAO accountDAO;

	@Override
	public Account getByVcardNo(String vcardNo) {
		Account account = new Account();
		account.setVcardNo(vcardNo);
		account.setCurBal(new BigDecimal(new Random().nextInt(100) * 100));
		return account;
	}

	@Override
	public void update(Account account) {
		accountDAO.update(account);
	}

}
